package com.jeejam.cart.sdk.api;

import com.jeejam.cart.sdk.dto.CartDto;
import com.jeejam.cart.sdk.dto.CartItemDto;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public interface ICartService {
	
	public CartDto getCart(HttpServletRequest request) throws Exception;

	public CartDto getCartByCookie(HttpServletRequest request) throws Exception;
	
	public void add(CartDto currentCart, CartItemDto cartItem, HttpServletRequest request, HttpServletResponse response) throws Exception;
	
	public String parse(CartDto cart);
	
	public CartDto translate(String cartStr);
	
	public void saveWithMember(int userId, HttpServletRequest request, HttpServletResponse response) throws Exception;
	
	public void clearByCookie(HttpServletRequest request, HttpServletResponse response) throws Exception;
	
	public void deleteByCookie(HttpServletResponse response) throws Exception;
	
	public CartDto findByUserId(int userId);
	
	public void addWithMember(CartDto currentCart, CartItemDto cartItem, int userId);
	
	public void clearByUserId(int userId);
	
	public void deleteItemByProductId(int productId, HttpServletRequest request, HttpServletResponse response) throws Exception;
	
	public void deleteWithMember(int userId, int productId);
	
	public CartDto findForConfirmByUserId(int userId);
	
}
